package com.hut.oa.model.dao.apply;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.hut.oa.model.bean.Apply;
import com.hut.oa.model.bean.DeptOffice;
import com.hut.oa.model.bean.User;

public interface ApplyDao extends PagingAndSortingRepository<Apply, Long>{
	
	Page<Apply> findByUserId(Long userId,Pageable pageable);
	
	Page<Apply> findByDeptOffice(DeptOffice deptOffice,Pageable pageable);
	
	List<Apply> findByDeptOffice(DeptOffice deptOffice);
	
	Page<Apply> findByStatusAndUser(Integer status,User user,Pageable pageable);
	
	Page<Apply> findByStatusAndDeptOffice(Integer status,DeptOffice deptOffice,Pageable pageable);
	
	Apply findById(Long id);
}
